#if 0
#ifndef _CBBOXREMOTE_H_
#define _CBBOXREMOTE_H_

#include <buola/bbox/protocol/cconnection.h>

namespace buola { namespace bboxd {

class CMaster;
    
class CRemote : public bbox::protocol::CConnection
{
public:
    //used when this daemon acts as server
    CRemote(CMaster *pApp,io::PSocket pSocket);
    //used when this daemon acts as client
    CRemote(CMaster *pApp,const std::string &pHost);
    
    ~CRemote();

    const std::string &GetPeerUUID()    {   return mPeerUUID;   }
    const std::string &GetPeerHost()    {   return mPeerHost;   }
    void FindClient(const std::string &pName,std::vector<std::string> &pClients);
    void FindBoxes(const std::string &pClient,const std::string &pBox,
                   std::vector<std::tuple<std::string,std::string,uint64_t>> &pBoxes);
    bool BindPeerConnection(uint64_t pID,const std::string &pName,const std::string &pThisPeer);
    
private:
    void ProcessFindClient(bbox::protocol::CPacket *pPacket);
    void ProcessFindBox(bbox::protocol::CPacket *pPacket);
    void ProcessClientList(bbox::protocol::CPacket *pPacket);
    void ProcessBindPeer(bbox::protocol::CPacket *pPacket);

    void ProcessRequest(bbox::protocol::CPacket *pPacket);
    
    void OnEOF();
    void OnHelloReceived(const std::string &pPeerUUID);
    
    CMaster *mMaster;

    std::string mPeerUUID;
    std::string mPeerHost;
};

/*namespace bboxd*/ } /*namespace buola*/ }

#endif
#endif